package com.fifth.common.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 第五组
 * @since 2022-09-02
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("u_comment")
@ApiModel(value = "Comment对象", description = "")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    @ApiModelProperty("订单编号")
    private String code;

    @ApiModelProperty("评论信息")
    private String info;

    @ApiModelProperty("评论图片")
    private String img;

    @ApiModelProperty("等级评价(1-5)")
    private Integer level;

    @DateTimeFormat(pattern = "yyyy-MM-dd 'T' HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty("评论时间")
    @TableField(fill = FieldFill.INSERT)//添加时自动当前时间
    private LocalDateTime createtime;

    @DateTimeFormat(pattern = "yyyy-MM-dd 'T' HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.UPDATE)//修改时自动当前时间
    private LocalDateTime updatetime;

    @TableLogic //标记该列为逻辑删除列
    @ApiModelProperty("逻辑删除")
    private int isDeleted;

    @ApiModelProperty("用户id")
    private String userid;

    @ApiModelProperty("商品id")
    private String goodsid;

    @ApiModelProperty("商家id")
    private String bid;

    @ApiModelProperty("0正常 1禁用")
    @TableField(fill = FieldFill.INSERT)
    private int status;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String[] imgs;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String username;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String userimg;

}
